// !@#$McCaBe-InStRuMeNtAtIoN$#@!
// Instrumented with the McCabe Java Parser
// Version: 8.1.0.1 - 20110309
// Using Path Vector Instrumentation
// Date: Sun Apr 01 2012 20:39:54
package EventManager;

import Driver.Facade;
import Model.Booking;
import Model.Person;
import Service.EventClosedException;

import com.mccabe.*;


class CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f {
    static java.lang.Object info[];
    static {
        info = new java.lang.Object[2];
        info[0] = new Integer(-1);
        info[1] = new String("R:\\yu\\Concordia\\SOEN 344 Design II\\Term Assignment\\Code Repo\\trunk\\Iteration 3\\ERS\\src\\EventManager\\CreateBookingRequest.java");
    }
}


public class CreateBookingRequest extends UserRequest 
{

	private Person person;
	private int eventId;
	private int desiredSeatNumber;
	private Booking booking = null;
	
	
	/**
	 * Constructor
	 * @param person The person for which the booking is made
	 * @param eventId The event ID
	 * @param seat The desired seat (can't be guaranteed!)
	 */
	public CreateBookingRequest(Person person, int eventId, int desiredSeatNumber) 
	{
		super();
int _mcFreq_29bbf755ca6605a775ab5d38b1ad567c[] = PathVec_ERS_Iter3.getIntArray(0);
PathVec_ERS_Iter3.releaseIntArray();
PathVec_ERS_Iter3.enterConstructorWithECC(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,0,_mcFreq_29bbf755ca6605a775ab5d38b1ad567c,0);

		this.person = person;
		this.eventId = eventId;
		this.desiredSeatNumber = desiredSeatNumber;
	}

	public Person getPerson() 
	{
int _mcFreq_3dac6d58fcca14551e592bf0409f77e2[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,1,_mcFreq_3dac6d58fcca14551e592bf0409f77e2,0);

		return person;
	}

	public void setPerson(Person person) 
	{
int _mcFreq_43b376ee541f295ce21ba2713cba1e41[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,2,_mcFreq_43b376ee541f295ce21ba2713cba1e41,0);

		this.person = person;
	}

	public int getEventId() 
	{
int _mcFreq_4c4259c919aec2303ea9e143e8db96d1[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,3,_mcFreq_4c4259c919aec2303ea9e143e8db96d1,0);

		return eventId;
	}

	public void setEventId(int eventId) 
	{
int _mcFreq_4243a04bf4dcb97602be011327b92e58[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,4,_mcFreq_4243a04bf4dcb97602be011327b92e58,0);

		this.eventId = eventId;
	}

	public Booking getBooking() 
	{
int _mcFreq_a89cca7e6f4771e30d18b48497c40bcb[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,5,_mcFreq_a89cca7e6f4771e30d18b48497c40bcb,0);

		return booking;
	}
	
	@Override
	public void process() 
	{
int _mcFreq_53acd088494349bab7d5fba827d58953[] = new int[4];
PathVec_ERS_Iter3.enterMethod(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,6,_mcFreq_53acd088494349bab7d5fba827d58953,0);

		
{boolean __MCCABE_SKIPNEXT_EVENT_17 = false;
try {try 
		{
			Booking b = Facade.getManager().makeBooking(person, eventId, desiredSeatNumber);
			this.booking = b;
			setStatus(RequestStatus.Sustained);
		} 
		catch (EventClosedException e) 
		{
PathVec_ERS_Iter3.decision(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,6,_mcFreq_53acd088494349bab7d5fba827d58953,1,0,true);
__MCCABE_SKIPNEXT_EVENT_17 = true;

			setStatus(RequestStatus.Refused);
		}
if (!__MCCABE_SKIPNEXT_EVENT_17)

PathVec_ERS_Iter3.decision(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,6,_mcFreq_53acd088494349bab7d5fba827d58953,3,0,true);
__MCCABE_SKIPNEXT_EVENT_17 = true;

} finally {
    if (!__MCCABE_SKIPNEXT_EVENT_17)
        PathVec_ERS_Iter3.decision(CreateBookingRequest_9349df30db7c1e49ad2c287fc53eac6f.info,6,_mcFreq_53acd088494349bab7d5fba827d58953,2,0,true);
}}

	}

}
